package com.amit.Basic_Simple_Program;

import java.util.Scanner;

public class Gcd_And_Lcm 
{

	static int temp;
	static int gcd;
	static int lcm;
	static int x;
	static int y;
	static int a;
	static int b;
	public static void main(String[] args) {
		
		System.out.println("Please enter two numbers");
		
		Scanner sc=new Scanner(System.in);
		int x=sc.nextInt();
		 
		int y=sc.nextInt();
		
		a=x;
		b=y;
		
		
		while(b!=0)
		{
			temp=b;
			b=a%b;
			a=temp;
			
		}
		gcd=a;
		lcm=(x*y)/(gcd);
		
		System.out.println("The Gcd of given number is "+" "+gcd);
		System.out.println("The Lcm of given number is "+" "+lcm);
			
		
	}

}
